<?php use_helper('jQuery')?>

<fieldset id="<?php echo 'feature_'.$num ?>">
    <legend>Destacado</legend>
    <div class="form-row">
        <?php echo $form['FeaturesBlock']['Features'][$num]['type_id']->renderLabel() ?>
        <div class="form-field">
            <?php echo $form['FeaturesBlock']['Features'][$num]['type_id']->render() ?>
            <?php echo $form['FeaturesBlock']['Features'][$num]['type_id']->renderError() ?>
        </div>
    </div>
    <div class="form-row">
        <?php echo $form['FeaturesBlock']['Features'][$num]['content_id']->renderLabel() ?>
        <div class="form-field">
            <?php echo $form['FeaturesBlock']['Features'][$num]['content_id']->render() ?>
            <?php echo $form['FeaturesBlock']['Features'][$num]['content_id']->renderError() ?>
        </div>
    </div>
    <div class="form-row">
        <?php echo $form['FeaturesBlock']['Features'][$num]['is_new']->renderLabel() ?>
        <div class="form-field">
            <?php echo $form['FeaturesBlock']['Features'][$num]['is_new']->render() ?>
            <?php echo $form['FeaturesBlock']['Features'][$num]['is_new']->renderError() ?>
        </div>
    </div>
    <div class="form-row">
        <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary"
           id="<?php echo 'feature_'.$num ?>" href="#" aria-disabled="false">
            <span class="ui-button-icon-primary ui-icon ui-icon-minusthick"></span>
            <span class="ui-button-text">Eliminar</span>
        </a>
    </div>
</fieldset>
<?php echo jq_javascript_tag("
        $('a#feature_".$num."').click(function() {
            removeFeature($(this).parent().parent());
        });
    ")?>